﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FrameworkX.ObjectSpace.Data.Providers;
using System.Reflection;

namespace FrameworkX.ObjectSpace.Data.Schema
{
    public class ConstraintAttribute  : System.Attribute 
    {
        public delegate bool SqlGeneratorDelegate(IDatabaseProvider provider, Type typeAppliedOn, PropertyInfo pinfo,
        StringBuilder sbBeforeTable, StringBuilder sbField, StringBuilder sbAfterTable, StringBuilder sbPostGeneration);

        private SqlGeneratorDelegate _func = null;

        public ConstraintAttribute(SqlGeneratorDelegate func)
        {
            _func = func;
        }

        public SqlGeneratorDelegate GenerateSql 
        {
            get
            {
                return _func;
            }
        }
    }


}
